package live.jialing.sip.contact.employee.repository;

import live.jialing.core.data.jpa.CustomJpaRepository;
import live.jialing.sip.contact.employee.domain.EmployeeGroup;
import live.jialing.sip.contact.student.domain.StudentGroup;
import org.springframework.data.jpa.repository.Query;


public interface EmployeeGroupRepository extends CustomJpaRepository<EmployeeGroup, Long> {

    /**
     * 获取组信息，包含员工信息
     *
     * @param groupId
     * @return
     */
    @Query("select g from EmployeeGroup g left join fetch g.employees where g.id = ?1")
    EmployeeGroup findGroupFetchEmployeeByPK(long groupId);

}